﻿using System;
using System.Collections.Generic;
using System.Text;

namespace TEST03汽车
{
    //3.设计一个汽车类Vehicle，包含的属性有车轮个数wheels和车重weight。
    class Vehicle
    {
        protected double _weught;
        public int wheels { get { return 4; }}
        public double Weight { get { return _weught; } set { this._weught = value; } }
    }
    //小车类Car是Vehicle的子类，其中包含的属性有载人数loader。
    class Car:Vehicle
    {
        public int loader;
        public void C()
        {
            Console.WriteLine("小车核定载人数{0},车轮个数为{1}，车重{2}",loader,wheels,Weight);
        }

    }
    //卡车类Truck是Car类的子类，其中包含的属性有载重量payload。
    class Truck : Car
    {
        public double payload;
        public void T()
        {
            
            Console.WriteLine("卡车载重量{0}，车轮个数为{1},车重{2}",payload,wheels,Weight);
        }
    }
}
